package edu.ccut.saturn.component.loader.data;

import org.dom4j.Text;

import edu.ccut.saturn.component.ISaturnDataSqlItemInfo;
import edu.ccut.saturn.component.impl.sql.SqlTextInfo;

public class TextItemInfoLoader extends AbstractSqlItemInfoLoader {

	@Override
	public ISaturnDataSqlItemInfo loadSqlItemInfo(Object element)
			throws Exception {

		if (element instanceof Text) {
			String text = ((Text) element).getText();

			if (text != null && !"".equals(text)) {
				return new SqlTextInfo(text);
			}
		}
		return null;
	}

}
